import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ContentInteractionVO, ContentInteractionForm, ContentInteractionQuery } from '@/api/business/contentInteraction/types';

/**
 * 查询统一内容互动行为列表
 * @param query
 * @returns {*}
 */

export const listContentInteraction = (query?: ContentInteractionQuery): AxiosPromise<ContentInteractionVO[]> => {
  return request({
    url: '/business/contentInteraction/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询统一内容互动行为详细
 * @param id
 */
export const getContentInteraction = (id: string | number): AxiosPromise<ContentInteractionVO> => {
  return request({
    url: '/business/contentInteraction/' + id,
    method: 'get'
  });
};

/**
 * 新增统一内容互动行为
 * @param data
 */
export const addContentInteraction = (data: ContentInteractionForm) => {
  return request({
    url: '/business/contentInteraction',
    method: 'post',
    data: data
  });
};

/**
 * 修改统一内容互动行为
 * @param data
 */
export const updateContentInteraction = (data: ContentInteractionForm) => {
  return request({
    url: '/business/contentInteraction',
    method: 'put',
    data: data
  });
};

/**
 * 删除统一内容互动行为
 * @param id
 */
export const delContentInteraction = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/contentInteraction/' + id,
    method: 'delete'
  });
};
